﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Model.ProjectDirectory>" %>
<div class="wrapper">
    <div class="left">
        <table border="0" cellpadding="0" cellspacing="0" class="tbl-form">
            <tr>
                <th>
                    <span class="mandate">*</span> Project Name
                </th>
                <td >
                    <input type="text" name="ProjectName" id="ProjectName" class="input-size-custom inp-form validate[required]"
                        value="<%=(this.Model !=null)?this.Model.ProjectName:""%>" />
                    <a class="checkitem"></a>
                </td>
            </tr>
            <tr>
                <th>
                    <span class="mandate">*</span> Local Project Name
                </th>
                <td>
                    <input type="text" name="ProjectNameLocal" id="ProjectNameLocal" class="input-size-custom inp-form validate[required]"
                        value="<%=(this.Model !=null)?this.Model.ProjectNameLocal:""%>" />
                </td>
                <td>
                 
                </td>
            </tr>
            <tr>
                <th>
                    <span class="mandate">*</span> Property Type
                </th>
                <td>
                    <% Html.RenderPartial("PropertyType", (this.Model == null) ? "" : this.Model.PropertyTypeFID.ToString()); %>
                </td>
            </tr>
            <!-- PROPERTYCLASSIFICATION --->
            <tr>
                <th>
                    <span class="mandate">*</span> Property Classification
                </th>
                <td>
                    <select class="validate[required] chzn-nosearch chz" name="PropertyClsssm">
                        <option value="">Please select...</option>
                        <% if (this.Model != null)
                           { %>
                        <option value="Strata" <%=(this.Model.PropertyClsssm != null) ? (this.Model.PropertyClsssm.ToString().Equals("Strata")) ? "selected='selected'" : "" : "" %>>
                            Strata</option>
                        <option value="Landed" <%=(this.Model.PropertyClsssm != null) ? (this.Model.PropertyClsssm.ToString().Equals("Landed")) ? "selected='selected'" : "" : "" %>>
                            Landed</option>
                        <%}
                           else
                           { %>
                        <option value="Strata">Strata</option>
                        <option value="Landed">Landed</option>
                        <%} %>
                    </select>
                </td>
            </tr>
            <!-- END PROPERTYCLASSSIFICATION -->
            <!--Begin City-->
            <% 
                string ControllerName = Html.ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
                string[] strCityLoSub = new string[] { "", "", "" };
                string[] strCountryCity = new string[] { "", "" };
                if (this.Model != null)
                {
                    if (ControllerName == "PropertyInternational" || ControllerName == "ProjectInternational" || ControllerName == "ProjectDirectoryInt")
                    {
                        strCountryCity = new string[] { this.Model.CountryFID.ToString(), this.Model.City };
                        // 

                    }
                    else
                    {
                        if (this.Model.SubAreaFID != null)
                        {
                            strCityLoSub = new string[] { this.Model.CityFID.ToString(), this.Model.LocaltionFID.ToString(), this.Model.SubAreaFID.ToString() };
                        }
                        else
                        {
                            strCityLoSub = new string[] { this.Model.CityFID.ToString(), this.Model.LocaltionFID.ToString(), "" };
                        }
                    }

                }
                if (ControllerName == "PropertyInternational" || ControllerName == "ProjectInternational" || ControllerName == "ProjectDirectoryInt")
                {
                    Html.RenderPartial("CountryCity", strCountryCity);
                }
                else
                {
                    Html.RenderPartial("CityLocationSubarea", strCityLoSub);
                }
            %>
            <!--End City-->
            <!-- STREETNAME --->
            <tr>
                <th style="max-width: 100px;">
                    <span class="mandate">*</span> Street Name<br />
                </th>
                <td >
                    <% Html.RenderPartial("StreetName", (this.Model == null) ? "" : this.Model.StreetNameFID.ToString()); %>
                </td>
            </tr>
            <!-- END STREETNAME -->
            <!-- HOUSENUMBER --->
            <tr>
                <th>
                    <span class="mandate">*</span> House #
                </th>
                <td>
                    <input type="text" name="HouseNumber" class="validate[required] input-size-custom inp-form" value="<%=(this.Model!=null)?this.Model.HouseNumber:""%>" />
                </td>
            </tr>
            <!-- END HOUSENUMBER -->
            <!-- TENURE --->
            <tr>
                <th>
                    <span class="mandate">*</span>Tenure
                </th>
                <td>
                    <input type="text" name="Tenure" id="tenure" class=" validate[required] input-size-custom inp-form"
                        value="<%=(this.Model == null) ? "" : this.Model.Tenure.ToString() %>" />
                </td>
            </tr>
            <!-- END TENURE -->
            
        </table>
    </div>
    <div class="right">
        <table border="0" cellpadding="0" cellspacing="0" class="tbl-form">
            <tr>
                <td colspan=4 >
                      <b><span class="mandate area_required">*</span>Description</b><br />
                    <input id="description_validate" class="validate[required]" style="visibility: hidden;
                        height: 0;" />
                    <textarea class="ckeditors" cols="" id="description" name="Description" rows="10"><%=(this.Model == null) ? "" :(this.Model.Description.ToString())%></textarea>
                    <br />
                    <b><span class="mandate area_required">*</span>Local Description</b><br />
                    <br />
                    <input id="descriptionlocal_validate" class="validate[required]" style="visibility: hidden;
                        height: 0;" />
                    <textarea class="ckeditors" cols="88" id="descriptionlocal" name="DescriptionLocal" rows="10"><%=(this.Model == null) ? "" : this.Model.DescriptionLocal.ToString()%></textarea>
                    <input id="description_validate" class="" style="visibility: hidden; height: 0;" />
                </td>
            </tr>
         
          
        </table>
    </div>
    <div style="clear: both; padding-top: 28px;">
        <table border="0" cellpadding="0" cellspacing="0" class="tbl-form" style="width: 100%;">
          
            <tr class="button_ctr">
                <td colspan="4" style="text-align: right;">
                    <br />
                    <% if(this.Model!=null){ %>
                       <input type="button" style="margin-right: 3px;" value="Next" class="buttons" onclick="javascript:window.location.href='<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step2/<%= ViewData["ListingID"].ToString()%>'" />
                       <%} %>
                    <input type="submit" style="margin-right: 5px" value="Save and proceed to Step 2" class="buttons"  onclick="checkForm();" />
                    
                 
                 
                   
                </td>
            </tr>
        </table>
    </div>
</div>
